//
//  RootCenterBaseController.m
//  iCarStyle
//
//  Created by liu nian on 14-5-12.
//  Copyright (c) 2014年 liunian. All rights reserved.
//

#import "RootCenterBaseController.h"

@interface RootCenterBaseController ()
@property (nonatomic, strong) UIButton *backBtn;
@end

@implementation RootCenterBaseController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backBtn];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)doShowMenu:(id)sender{
    [self presentLeftMenuViewController:sender];
}
#pragma mark 
- (UIButton *)backBtn{
    if (!_backBtn) {
        _backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        UIImage *image = [UIImage imageNamed:@"btn_nav_subscription_normal.png"];
        _backBtn.frame = CGRectMake(0, 0, image.size.width, image.size.height);
        [_backBtn setImage:image forState:UIControlStateNormal];
        [_backBtn addTarget:self action:@selector(doShowMenu:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _backBtn;
}
@end
